package jman.competition07;

public class Commodity {
	//商品静态属性：品牌、名字、价格、数量
	private String brand;
	private String name;
	private int price;
	private int num;
	public String getBrand() {
		return brand;
	}
	public void setBrand(String brand) {
		this.brand = brand;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public int getPrice() {
		return price;
	}
	public void setPrice(int price) {
		this.price = price;
	}
	public int getNum() {
		return num;
	}
	public void setNum(int num) {
		this.num = num;
	}
	//重写equals()方法
	public boolean equals(Commodity commodity){
		if(this.name.equals(commodity.getName())&&this.brand.equals(commodity.getBrand())){
			return true;
		}else{
			return false;
		}
	}
}
